﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace FanaticRock.MediaSource.BilibiliAPI.RequestVo.Fav.Resource
{
    public class ResourceInfo
    {
        public long Id { get; set; }
        public long Type { get; set; } =2;

        public ResourceInfo(long id)
        {
            Id = id;
        }

        public override string ToString()
        {
            return $"{Id}:{Type}";
        }
    }

    public class InfosRequestVo
    {
        [JsonPropertyName("resources")]
        public string Resources { get; set; }

        [JsonPropertyName("platform")]
        public string Platform { get; set; } = "Web";

        [JsonPropertyName("folder_mid")]
        public string FolderMid { get; set; }

        [JsonPropertyName("folder_id")]
        public string FolderId { get; set; }

        public InfosRequestVo(IEnumerable<ResourceInfo> resourceList, string folderMid, string folderId)
        {
            Resources = string.Join(',',resourceList);
            FolderMid = folderMid.ToString();
            FolderId = folderId.ToString();
        }
    }
}
